import request from '@/utils/request'

export function getCompanyInfo(id) {
    return request({
        url: `/company/${id}`
    })
}


export function getRoleList(params) {
    return request({
        url: "/sys/role",
        params
    })
}

export function delRole(id) {
    return request({
        url: `/sys/role/${id}`,
        method: 'DELETE'
    })
}

export function addRole(data) {
    return request({
        url: `/sys/role/`,
        method: 'post',
        data
    })
}

// 获取角色详情
export function getRoleDetail(id) {
    return request({
        url: `/sys/role/${id}`
    })
}

// 更新角色
export function updateRole(data) {
    return request({
        url: `/sys/role/${data.id}`,
        method: 'put',
        data
    })
}

// 设置角色权限
export function assignPerm(data) {
    return request({
        url: `/sys/role/assignPrem`,
        method: 'put',
        data
    })
}